package o;

import android.os.Handler;
import android.text.TextUtils;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class cof extends cnx {
    public List<a> ʽ;

    public static class a {
        public String ˎ;
        public String ˏ;
        public int ॱ;

        public String toString() {
            return TextUtils.join(HiAnalyticsConstant.REPORT_VAL_SEPARATOR, new String[]{this.ˎ, this.ˏ, String.valueOf(this.ॱ)});
        }

        public static a ॱ(String str) {
            a aVar = new a();
            if (!TextUtils.isEmpty(str)) {
                String[] split = str.split("\\|");
                if (split.length == 3) {
                    aVar.ˎ = split[0];
                    aVar.ˏ = split[1];
                    try {
                        aVar.ॱ = Integer.parseInt(split[2]);
                    } catch (NumberFormatException e) {
                        Logger.e("InstallApk", "can not parseInt:" + split[2]);
                    }
                }
            }
            return aVar;
        }

        private a() {
        }
    }

    public static final class d {
        private coi ʼ;
        private coc ʽ = coc.NORMAL;
        private int ˊ;
        private long ˋ;
        private String ˎ;
        private int ˏ;
        private List<a> ॱ = new ArrayList();
        private Object ॱॱ;
        private Handler ᐝ;

        public d ˋ(String str) {
            this.ˎ = str;
            return this;
        }

        public d ॱ(String str, String str2, int i) {
            a aVar = new a();
            aVar.ˎ = str;
            if (TextUtils.isEmpty(str2)) {
                aVar.ˏ = "base";
            } else {
                aVar.ˏ = str2;
            }
            aVar.ॱ = i;
            this.ॱ.add(aVar);
            return this;
        }

        public d ˏ(int i) {
            this.ˏ = i;
            return this;
        }

        public d ˊ(int i) {
            this.ˊ = i;
            return this;
        }

        public d ˏ(Object obj) {
            this.ॱॱ = obj;
            return this;
        }

        public d ˊ(coc o_coc) {
            this.ʽ = o_coc;
            return this;
        }

        public d ˏ(coi o_coi) {
            this.ʼ = o_coi;
            return this;
        }

        public d ॱ(Handler handler) {
            this.ᐝ = handler;
            return this;
        }

        public cof ˎ() {
            cof o_cof = new cof();
            o_cof.ˊ = this.ˋ;
            o_cof.ˊ = coq.ˎ(o_cof.ˊ);
            o_cof.ˏ = this.ˎ;
            o_cof.ˋ = this.ˏ;
            Collections.sort(this.ॱ, new e());
            o_cof.ʽ = this.ॱ;
            o_cof.ॱ = this.ˊ;
            o_cof.ˎ = this.ॱॱ;
            o_cof.ᐝ = this.ʽ;
            o_cof.ʻ = this.ʼ;
            o_cof.ॱॱ = this.ᐝ;
            return o_cof;
        }
    }

    static class e implements Comparator<a>, Serializable {
        public /* synthetic */ int compare(Object obj, Object obj2) {
            return ॱ((a) obj, (a) obj2);
        }

        private e() {
        }

        public int ॱ(a aVar, a aVar2) {
            return ˊ(aVar2) - ˊ(aVar);
        }

        private int ˊ(a aVar) {
            int i;
            int i2 = 0;
            if ("base".equals(aVar.ˏ)) {
                i = 10;
            } else {
                i = 0;
            }
            if (aVar.ॱ == 1) {
                i2 = 1;
            }
            return i + i2;
        }
    }

    private cof() {
    }
}
